<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <script>
        let number=30
        let person={
            uame:"张三",
            height:180
        }
        console.log(person);

        Object.defineProperty(person,"age",{
            get(){
                console.log('在读取age属性时调用getter方法');
                return number
            },
            set(value){
                console.log('在设置时调用set方法');
                number=value
            }
           
        })
    </script>
</body>
</html>